<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="js/vue.min.js"></script>
    <title>v-on的基本使用</title>
</head>
<body>
<div id="app">
    <h2>{{count}}</h2>

    <!-- <button v-on:click="count++">加</button>
    <button v-on:click="count--">减</button> -->
    <button @click="increment">加</button>
    <button @click="decrement()">减</button>
</div>
</body>
<script>
    const app = new Vue({
        el:"#app",
        data:{
            count:0
        },
        methods:{
            increment(){
                this.count++;
            },
            decrement(){
                this.count--;
            }
        }
    })
</script>
</html>